#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>


class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int a = 0, b = 0;
        for (int e : nums)
        {
            b = ~a & (b ^ e);
            a = ~b & (a ^ e);
        }
        return b;
    }
};

